<!-- Modal -->
<div id="frm-post-popup" class="white-popup" style="max-width: 745px">
    <div class="weibo_post_box">
        <h2>投诉</h2>

        <div class="aline" style="margin-bottom: 10px"></div>
        <div class="row" style="margin: 10px;">


            <div class="col-xs-12">

                <form class="form-horizontal ajax-form" role="form" action="{:U('help/usercenter/complain')}"
                      method="post"
                      id="edit-article-form">
                    <input type="hidden" name="help_id" value="{$help_id}"/>

                    <div class="row">
                        <!-- 帖子分类 -->
                        <div class="col-sm-12 has-feedback" style="">
                            <div class="form-group ">
                                <div class="col-sm-6">
                                <div>向一起拍片网投诉</div>

                                    <textarea type="text" name="content" class="form-control"  style="height: 200px;"></textarea>
                                </div>

                                <div class="col-sm-6">
                                    <div>添加证明图片</div>
                                    <div class="pull-left publish_work_image_list" id="add_image" style="margin-left: 15px;">
                                        <input type="hidden" name="image" id="image_{$unid}">
                                        <div class="img-list clearfix">
                                            <ul id="ul_{$unid}" style="-webkit-padding-start: 0px;">
                                                <li id="btn_{$unid}"><input style="display:none" id="uploadify_{$unid}" type="file" /></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                    <p class="" style="margin: 0 auto 20px auto;width: 200px;">
                        <button type="submit" class="btn btn-large btn-primary" id="submit-button">
                            <span id="submit-content">
                                    确定投诉
                            </span>
                        </button>
                    </p>
                </form>
            </div>
        </div>

        <button title="Close (Esc)" type="button" class="mfp-close" style="color: #333;">×</button>
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/Core/js/multi_upload.js"></script>
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script>
    var unid = "{$unid}",
            fileSizeLimit = "{$fileSizeLimit}"
    $('#uploadify_'+unid).uploadify({
        formData: {
            attach_type: 'feed_image',
            upload_type: 'image',
            thumb: 1,
            width: 100,
            height: 100,
            cut: 1,
            PHPSESSID: "<?php echo session_id(); ?>"
        },
        fileSizeLimit: fileSizeLimit,
        fileTypeDesc: 'Image Files',
        fileTypeExts:  '*.jpg; *.png; *.gif;',
        swf: '__STATIC__/uploadify/uploadify.swf',
        uploader: "{:U('Home/File/uploadPicture',array('session_id'=>session_id()))}",
        width: 80,
        height: 80,
        buttonImage: '__ROOT__/Addons/InsertImage/_static/image/add-photo-multi.png',
        queueSizeLimit:0,
        queueID: true,
        overrideEvents: ['onSelectError', 'onDialogClose'],
        onUploadSuccess : function(file, data, response) {
            var jsondata = $.parseJSON(data);
            multi_upload.removeLoading(unid);
            if (jsondata.status === 1) {
                $('#btn_'+unid).before($('<li id="li_'+unid+'_'+file.index+'"><img src="'+jsondata.path+'" width="80" height="80" /><a href="javascript:;" onclick="multi_upload.removeImage(\''+unid+'\', '+file.index+', '+jsondata.id+')"><span class="del">删除</span></a></li>').fadeIn('slow'));
            }
            multi_upload.upAttachVal('add', jsondata.id,unid);
        },
        onUploadStart: function (file) {
            multi_upload.addLoading(unid);
        }    ,
        onSelectError: function (file, errorCode, errorMsg) {
            switch (errorCode) {
                case -100:
                    toast.error('选择的上传数目超过，您还能上传'+errorMsg+'个图片');
                    break;
                case -110:
                    toast.error("文件 [" + file.name + "] 大小超出系统限制的" + $('#uploadify_'+unid).uploadify('settings', 'fileSizeLimit') + "大小", 4);
                    break;
                case -120:
                    toast.error("文件 [" + file.name + "] 大小异常");
                    break;
                case -130:
                    toast.error("文件 [" + file.name + "] 类型不正确");
                    break;
            }
        },
        onFallback: function () {
            toast.error('您未安装FLASH控件，无法上传！请安装FLASH控件后再试');
        }
    });
</script>
<!-- /.modal -->

